﻿namespace Cards
{
    /// <summary>
    ///     Summary description for Card
    /// </summary>
    public enum CardSuit
    {
        Hearts,
        Spades,
        Clubs,
        Diamonds
    }

    public enum CardRank
    {
        Ace = 1,
        Two = 2,
        Three = 3,
        Four = 4,
        Five = 5,
        Six = 6,
        Seven = 7,
        Eight = 8,
        Nine = 9,
        Ten = 10,
        Jack = 11,
        Queen = 12,
        King = 13
    }

    public class Card
    {
        public Card(CardSuit suit, CardRank rank)
        {
            Suit = suit;
            Rank = rank;
        }

        public CardSuit Suit { get; set; }

        public CardRank Rank { get; set; }

        public static string Plural(CardRank rank)
        {
            if (rank == CardRank.Six)
                return "sixes";
            
            return rank + "s";
        }

        public override string ToString()
        {
            return string.Format("{0} of {1}", Rank, Suit);
        }
    }
}